<?php
Yii::app()->clientScript->registerScript('quick-edit', "
$('#quick_edit form').submit(function(){
$.fn.yiiGridView.update('catalog-grid', {
data: $(this).serialize()
});
return false;
});
");
?>

<div class="form" id="quick_edit">
    <?php
    /** @var CatalogController $this */
    /** @var Catalog $model */
    /** @var AweActiveForm $form */
    $form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array(
        'id' => 'catalog-form',
        'type'=>'horizontal',
//        'enableAjaxValidation' => true,
//        'enableClientValidation'=> false,
//        'action' => $this->createUrl('catalog/relational'),
//        'method' => 'post',
    )); ?>

    <p class="note">
    <?php echo $form->errorSummary($model) ?>
    <?php echo $form->textFieldRow($model, 'catalog_name', array('class' => 'span5', 'maxlength' => 50)) ?>
    <?php echo $form->textFieldRow($model, 'sort_id', array('class' => 'span5')) ?>
    <?php echo $form->dropDownListRow($model, 'parent', CHtml::listData(Catalog::model()->findAll(), 'id', Catalog::representingColumn()), array('prompt' => Yii::t('AweApp', 'None'))) ?>
    <div class="form-actions">
        <?php $this->widget('bootstrap.widgets.TbButton', array(
            'buttonType'=>'submit',
            'type'=>'primary',
            'label'=>$model->isNewRecord ? Yii::t('AweCrud.app', 'Create') : Yii::t('AweCrud.app', 'Update'),
        )); ?>
        <?php $this->widget('bootstrap.widgets.TbButton', array(
            //'buttonType'=>'submit',
            'label'=> Yii::t('AweCrud.app', 'Cancel'),
            'htmlOptions' => array('onclick' => 'javascript:history.go(-1)')
        )); ?>
    </div>

    <?php $this->endWidget(); ?>
</div>